#!/bin/bash
#set -x


#############################################################
## 
#############################################################

hosts="202.85.221.240"
user="yicheng"

tmpdir="/home/yicheng/prepare/stry/app/app"
targetdir="/opt/www/htdocs/stry/app"


for host in $hosts; do
	rsync  --exclude=\.* --exclude=tmp* --exclude=*.log --exclude=*svn* -avzt -l ./* $user@$host:$tmpdir

	ssh $user@$host "cd $tmpdir; diff . $targetdir -x '*.gif' -x '*cache*' -x '*.jpg' -x '*.txt' -x '*.sql' -x tags -x '*.png' -x '*.log' -x '*.htm' -x '*svn*' -ar "| less

	echo "Make sure upload?[yes|no]"
	read answer

	if [ 'yes' != $answer ];then
		exit;
	fi
	echo $answer

	ssh $user@$host "cd $tmpdir; rsync --exclude=*.log -avzt -l ./* $targetdir"

done


exit
